#ifndef ENCODER_H
#define ENCODER_H

#include "GF.h"
#include "gf_types.h"
#include "poly.h"

#define swap(a, b) ((a)^=(b),(b)^=(a),(a)^=(b))

/* Create a generator polynomial for the GF(2^m) with t-error capability */
Vector * RS_generator(int m, Matrix * add_one, int t);

/* Given a data word, encode it into a Reed-Solomon code word */
Vector * RS_encoder(int m, Matrix * add_one, int t, Vector * D, Vector * g);

#endif
